package com.cfswt.tasksystem.mapper;

import com.cfswt.tasksystem.pojo.dto.*;
import com.cfswt.tasksystem.pojo.entity.TaskDelay;
import com.cfswt.tasksystem.pojo.vo.*;
import com.cfswt.tasksystem.pojo.entity.CfswtTask;
import org.apache.ibatis.annotations.Mapper;

import java.time.LocalDate;
import java.util.Date;
import java.util.List;

@Mapper
public interface TaskMapper {
    Integer insertCfswtTask(CfswtTask cfswtTask);

    Integer insertMeetingTask(ReleaseTaskDTO meetingTasks);

    Integer countTasksByDate(LocalDate date);

    ReportTaskVO selectTaskByProcessInstanceId(String id);

    ApprovalTaskVO selectApprovalTaskByInstanceId(String id);

    List<GanttTaskVO> selectGanttTasksByReportName(String userName);

    List<GanttTaskVO> selectGanttTasksByReleaseName(String userName);

    List<GanttTaskVO> selectAllGanttTasks();

    List<GanttTaskVO> selectGannttTasksByParentId(Integer parentId);

    GanttTaskVO selectTaskDetailById(Integer id);

    int updateTaskStatusByTaskId(Integer taskId , Integer statusId);

    int updateTaskStatusByProcessInstanceId(String processInstanceId , Integer statusId);

    int updateTaskCompleteTimeById(Integer taskId, Date actualFinishingTime);

    int updateTaskDelayById(ApprovedDelayDTO approvedDelayDTO);

    Date selectTaskApprovedDateById(Integer taskId);

    Date selectTaskEndDateById(Integer taskId);

    Date selectTaskActualEndDateById(Integer taskId);

    List<TaskStatusVO> selectTaskStatus();

    int transmitTaskAssignee(Integer id, String userName);

    int insertTaskCompleteApply(TaskCompleteApplyDTO taskCompleteApplyDTO);

    TaskCompleteApplyVO selectTaskCompleteLatestApplyByTaskId(Integer id);

    int updateTaskCompleteApplyByTaskId(ApprovedCompleteDTO approvalCompleteDTO);

    List<TaskHistoryCompleteVO> selectTaskCompleteApplyByTaskId(Integer id);

    int selectReportCompleteByTaskId(Integer id);

    int updateReportCompleteByTaskId(Integer id,Integer reportComplete);

    Boolean selectTaskById(int id);

    int updateTaskById(CfswtTask cfswtTask);

    CfswtTask selectTaskInfoById(Integer id);

    List<GanttTaskVO> selectTaskByKpiDetailId(Integer id);

    CfswtTask selectTaskInfoByTaskId(Integer id);

    int updateTaskSortBatch(SchemeTaskSortDTO schemeTaskSortDTO);

    int selectTaskIdByProcessInstanceId(String processInstanceId);


}
